import { isAdmin } from '../character'

/** 自定义注册指令 */
export const regDirectives = app => {
  app.directive('only-admin', {
    mounted (el, { value = true }) {
      const res = isAdmin()
      if (!res && value) {
        el.style.display = 'none'
      }
    }
  })
}
